package com.yst.webplugin.api;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.*;

/**
 * Document of Application
 */
@Data
@Accessors(chain = true)
public class ApiApplication implements Serializable {
    /**
     * list of document
     */
    private List<Document> documents=new ArrayList<>();
    /**
     * list of entity
     */
    private Map<String, ApiEntity> entities=new HashMap<>();


    /**
     * call this function to clear document
     */
    public void clear(){
        if (Objects.nonNull(documents)){
            documents.clear();
        }

        if (Objects.nonNull(entities)){
            entities.clear();
        }
    }

    /**
     * request path of the document
     */
    private String path="/";
}
